package com.ridanlabs.professorwebsite.validation;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

import com.ridanlabs.professorwebsite.general.CourseSeason;

public class SeasonValidator implements ConstraintValidator<Season, String>{

	@Override
	public void initialize(Season constraintAnnotation) {}

	@Override
	public boolean isValid(String value, ConstraintValidatorContext context) {
		if( CourseSeason.fromString(value) == null )
			return false;
		
		return true;
	}

}
